package org.openmore.consumer.service.feignImpl;

import feign.hystrix.FallbackFactory;
import org.openmore.consumer.dto.common.BaseResponse;
import org.openmore.consumer.dto.common.LoginParams;
import org.openmore.consumer.service.feign.AccountService;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class AccountServiceImpl extends BaseFeignFallback implements FallbackFactory<AccountService> {
    @Override
    public AccountService create(Throwable cause) {
        return new AccountService() {
            @Override
            public BaseResponse login(String tenantId, LoginParams params) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse logout() {
                return getFallBackResponse();
            }
        };
    }
}
